---
title: Anthropic Provider
subtitle: Use Composio tools with Claude
slug: /providers/anthropic
image: "https://og.composio.dev/api/og?title=Anthropic%20Provider"   # image for socials
keywords: ""
hide-nav-links: false
---


The Anthropic Provider transforms Composio tools into a format compatible with Anthropic's function calling capabilities through its Messages API.

## Setup
The Anthropic provider can be installed for both SDKs.

<CodeGroup>
```bash title="Python" for="python" maxLines=60  wordWrap
pip install composio composio-anthropic
```

```bash title="TypeScript" for="typescript" maxLines=60  wordWrap
npm install @composio/anthropic @anthropic-ai/sdk
```
</CodeGroup>

You can specify the provider in the constructor. The constructor also takes in an optional `cacheTools` parameter.

<CodeGroup>
```python Python maxLines=60  wordWrap
import anthropic

from composio import Composio
from composio_anthropic import AnthropicProvider

# Initialize tools.
anthropic_client = anthropic.Anthropic()
composio = Composio(provider=AnthropicProvider())
```

```typescript TypeScript maxLines=60 wordWrap {5}
import { Composio } from "@composio/core";
import { AnthropicProvider } from "@composio/anthropic";
import Anthropic from '@anthropic-ai/sdk';

const composio = new Composio({
  provider: new AnthropicProvider({
    cacheTools: false,  // default
  }),
});

const anthropic = new Anthropic();
```
</CodeGroup>

## Usage

<CodeGroup>
```python Python maxLines=60  wordWrap
# Define your user ID
user_id = "your-user-id"

# Get GitHub tool for listing stargazers
tools = composio.tools.get(user_id=user_id, tools=["GITHUB_LIST_STARGAZERS"])

# Get response from the LLM
response = anthropic_client.messages.create(
    model="claude-sonnet-4-5",
    max_tokens=1024,
    tools=tools,
    messages=[
        {"role": "user", "content": "List my github stargazers. for the repo composiohq/composio"},
    ],
)

# Execute the function calls.
result = composio.provider.handle_tool_calls(user_id=user_id, response=response)
print(result)
```

```typescript TypeScript maxLines=60 wordWrap
const userId = "your-user-id";
const tools = await composio.tools.get(userId, {
  tools: ["GITHUB_LIST_STARGAZERS"]
})

const msg = await anthropic.messages.create({
  model: "claude-sonnet-4-5",
  messages: [
    {
      role: "user",
      content: "List my github stargazers. for the repo composiohq/composio",
    },
  ],
  tools: tools,
  max_tokens: 1000,
});

const res = await composio.provider.handleToolCalls(userId, msg);

console.log(res[0].content);
```
</CodeGroup>


## Modifiers
Modifiers are functions that can be used to intercept and optionally modify the schema, the tool call request and the response from the tool call.

Anthropic provider modifiers are the standard framework modifiers. Read more here: [Modifying tool schemas](/docs/modifying-tool-schemas).